The "not equal to" operator in C is '!=', the "not" operator is '!', the "and" operator is '&&', and the "or" operator is '||'. The condition in the following 'if' statement is true:
if (!(4==5) && 6!=7)
.
.
In English, it says: "if four equals five is NOT true, AND six does not equal seven...".
As a shorthand for the 'if' statement*, C provides the ternary (three-operand) conditional operator '?:'. The value of an expression using this operator depends upon the value of its first operand. If the first operand is true (non-zero), then the second operand is evaluated; else, the third is evaluated and becomes the value of the expression. The operator may be mixed freely with other operators. For example, the following assigns the value 12 to result: